package innerclass.匿名内部类;

/**
 * Created by chengxiaoqi1 on 2018/8/26.
 * 匿名内部类的基本实现
 */

abstract class Person2 {

    public abstract void eat();

}

public class Demo2 {


    public static void main(String[] args) {
        Person2 p = new Person2() {
            @Override
            public void eat() {
                System.out.println("eat sth");
            }
        };

        p.eat();
    }

}
